/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package testadventure;

import edu.clemson.cs.hamptos.adventure.AdventureCommand;
import edu.clemson.cs.hamptos.adventure.AdventureEngine;
import edu.clemson.cs.hamptos.adventure.AdventureTarget;
import edu.clemson.cs.hamptos.adventure.AdventureWindow;
import edu.clemson.cs.hamptos.adventure.VerbStrategyAlt;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

/**
 * The ending verbstrategy, handles final few commands.
 * @author Nicks
 */
public class VerbEnter implements VerbStrategyAlt {
    /**
     * 
     */
    protected final HashSet<String> verbs = new HashSet<String>();
    VerbEnter()
    {
        verbs.add("swipe");
        verbs.add("slide");
    }

    @Override
    public void doCommand(AdventureCommand c, AdventureEngine e, AdventureWindow w) {
        AdventureTarget theio = c.getIndirectObject();
        
        HashMap<String, Integer> iostats = theio.getStats();
        e.triggerEnding(iostats.get("charges"));
        
        w.println("Uh oh, you hear a distant rumbling...");
        w.println("Oh no! The bulkhead at the far end of the hallway opened up and ");
        w.println("a HORDE of ZOMBIES is rushing towards you!!!");
        w.println("Hey look, the keypad lit up. Quick! enter the password!");
    }

    @Override
    public String getName() {
        return "VerbEnter";
    }

    @Override
    public Set<String> getVerbs() {
        return new HashSet<String>(verbs);
    }
}